import { postReportHttp } from '@/Utils/api/report.js'
import { ref } from 'vue'
import { showNotify } from 'vant'
export const useReports = () => {
  const user_id = localStorage.getItem('common_use_id')
  const event = ref({
    event_type: '',
    event_describe: '',
    event_address: '',
    user_id
  })
  const handleSubmit = () => {
    // 添加事件
    postReportHttp(event.value)
    event.value.event_type = ''
    event.value.event_describe = ''
    event.value.event_address = ''
    showNotify({ type: 'success', message: '提交成功', duration: 1500 })
  }
  return { handleSubmit, event }
}
